//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TeacherList.h"
#include "datamodule.h"
#include "Group.h"
#include "main.h"
#include "Search.h"
#include "StatForm.h"
#include "StudentList.h"
#include "Teacher.h"
#include "Work.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TTeacherStat *TeacherStat;
//---------------------------------------------------------------------------
__fastcall TTeacherStat::TTeacherStat(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TTeacherStat::Button1Click(TObject *Sender)
{
        InitReport();
        QuickRep1->Preview();
}
//---------------------------------------------------------------------------
void __fastcall TTeacherStat::Button2Click(TObject *Sender)
{
        QuickRep1->Print();
}
//---------------------------------------------------------------------------

void __fastcall TTeacherStat::InitReport(void)
{
    int bm = dm->adGroups->RecNo;
    dm->adGroups->First();
    lbGroup->Caption = " ";

    while (!dm->adGroups->Eof)
    {
        if (dm->adGroupsTeacher->AsInteger
                == dm->adTeachersTeacher_Code->AsInteger)
            lbGroup->Caption = dm->adGroupsGroup_Number->AsString + " ";
        dm->adGroups->Next();
    }
    dm->adGroups->RecNo = bm;
}
